﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Jack416
{

    
    public class signaleton
    {
        public signaleton sig{
            set;
            get;
}

    }

    public class Person1 {
        public string Name {
            set;
            get;
        }
        public int Age {
            set;
            get;
        }
        public void SayHello() {
            Console.WriteLine("你好吗，我是Jackey");
        }


    }
    

    public class Jackeylove {
        private Jackeylove() { }

        static Jackeylove Jackey = null;

        public static Jackeylove jackeylove{
           
            get {
                if (jackeylove == null) {
                    Jackey = new Jackeylove();

                }
                return Jackey;

            }

        }


    }


    class Person {
        int a;
        //属性
        public int age;
        public int name;

        //行为，动作，方法
        public void run() {
            Console.WriteLine("我会跑！");

        }

    }

    
    public class Tank {
        private string type;
        private string speed;

        public Tank() {
            this.type = type;
        }
        public void run() {
            Console.WriteLine("I can run!");
        }

        public string Type {
            set {
                this.type = value;
            }
            get {
                return type;
            }

        }

    }

    public class pro<T> {

    }
   interface Number {
        void say();

    }
    class Mike {
        public static int count = 1;
        public Mike() {
            Console.WriteLine("I am Mike");
        }
        
        static Mike(){
            Console.WriteLine("I am real Mike!");
            count++;
}
        

    }
    public class Magic<T> {
        private T iu;


    }

    public delegate void Jac(int a,int b);


    class Program
    {

        static void runn() {
            Console.WriteLine(23456);
            return;
        }

        static void Cache(int a,int b) {
            a = a - b;
            b = b - a;
            Console.WriteLine($"a的值为：{a}");
            Console.WriteLine($"b的值为：{b}");
        }
        static void Jache(int a, int b) {
            a = a - b;
            b = b - a;
            Console.WriteLine($"a的值为：{a}");
            Console.WriteLine($"b的值为：{b}");


        }

        enum _NumberPlace{
            st,su,sd,sj
        }
        
        static void Main(string[] args)
        {
            Queue jak = new Queue();
            jak.Enqueue("J");
            jak.Enqueue("A");
            jak.Enqueue("C");
            jak.Enqueue("K");
            jak.Enqueue("E");
            jak.Enqueue("Y");
            jak.Enqueue("L");
            jak.Enqueue("O");
            jak.Enqueue("V");
            jak.Enqueue("E");
            int count = 0;
            Console.WriteLine("当前队列：");
            foreach(var a in jak)
                Console.WriteLine(a);
            Console.WriteLine("删除一些值");
            int inde = 0;
            while (inde <=jak.Count) {
                jak.Dequeue();
                inde++;
            }
            Console.WriteLine("删除后的队列为：");
            foreach(var c in jak)
                Console.WriteLine(c);
            Jac jac = new Jac(Cache);
            Jac jac2 = new Jac(Jache);
            jac(3,4);
            #region
            /*
            Pretage pretage = new Pretage();
            pretage.Length = 3;
            Console.WriteLine($"b3的值为：{pretage.Width}");

            var dict = new Dictionary<string, int>()
            {
                {"TV",1},
                {"Home",2},
                {"Computer",3},
                {"House",4},
                {"Jackeylove",5},
                {"Theshy",6},
            };
            var dict2 = new Dictionary<string,int>();
            dict2.Add("saqi",3);
            Console.WriteLine("请输入你要购买的商品，我们将返还商品的加密编号");
            string str = Console.ReadLine();


            if (dict.ContainsKey(str) )
                Console.WriteLine($"我有{str}");
            Console.WriteLine($"您要购买的商品编号为：{dict[str]}");
            */
            #endregion
            Type mytype = typeof(Pretage);
            object myInstance = Activator.CreateInstance(mytype);

            Mike mike = new Mike();
            Console.WriteLine(Mike.count); 
            Mike mike2 = new Mike();

            Tank tank2 = new Tank();
            string ii=tank2.Type;
            Array[] arrays = new Array[3];

            
           
         
            int aa = 2;
            int bb = 2;
            Console.WriteLine($"aa传递之前的值为：{aa},bb传递之前的值为：{bb}");
            int d = c(ref aa,ref bb);
            Console.WriteLine($"aa传递之后的值为：{aa},bb传递之后的值为：{bb}");

            int[] arr = new int[] {1,2,3,4,5,6 };
            for(int i=0;i<arr.Length;i++)
                Console.WriteLine($"arr[{i}]的值为：{arr[i]}");
            Console.WriteLine("--------------");
            int index = 0;
            foreach(var i in arr) { 
                Console.WriteLine($"arr[{index}]的值为：{i}");
                index++;
            }
            int j = arr.Count();
            int k = arr.Length;
            int[,] jinx = new int[1,1]{
                {1}
            };
            List<string> vs = new List<string>();
            vs.Add("a");
            vs.Add("b");
            foreach(var a in vs)
                Console.WriteLine("JackeyLove");
            Console.WriteLine($"枚举sd的值为:{(int)_NumberPlace.st}");

            Console.WriteLine( new signaleton());
            Queue que = new Queue();
            que.Enqueue(11);
            que.Enqueue("aa");
            Queue<string> queque = new Queue<string>();
            queque.Enqueue("a");
            queque.Enqueue("b");
            queque.Enqueue("c");
            queque.Enqueue("d");
            int length =0;
            while (length < queque.Count)
                queque.Dequeue();
            if(!queque.Contains("a"))
                Console.WriteLine("删除无效1111111！");
            //Jackeylove jackeylove = new Jackeylove();
            Console.ReadKey();
        }
        static int c(ref int a,ref int b) {
            a = 1;
            b = 3;
            return 0;
        }
    }

    public class Pretage {
        private double length=6;
        private double width=10 ;
        public double Length {
            set;
            get;
        }

        public double Width {
            set;
            get;

        }

        public Pretage(){
            this.Width = width/2;
            this.Length = length;

}


        public double Mianji() {

            return length * width;
        }




    }
}
